/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package my.facebook;

import com.restfb.types.Group;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;

/**
 *
 * @author Reza
 */
public class FBTester {
    public static void main(String[ ]areg){
        String accessToken = "2227470867|2.jtJm6yzx_mjmgumyCyM3yA__.3600.1303502400.0-597296639|qj6kkKTNiV-6WLz50hMXyeciDWE";
        GraphExample facebookGraph = new GraphExample(accessToken);
        List<Group> groups = facebookGraph.fqlGroups();
        Iterator<Group> itr = groups.iterator();
        HashSet<String> newGroups = new HashSet<String>();
        String ttt;
        System.out.println("groups in facebook are " + groups.size());
        while(itr.hasNext()){
            ttt = ">>group>> ".concat(itr.next().getDescription());
            newGroups.add(ttt);
            System.out.println(ttt);
        }
        //Long uid = facebookGraph.getUserId();
        String user = ">>user>> ".concat(facebookGraph.fqlUserName());
        System.out.println(user);
    }

}
